<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>idautils</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center">
            <p class="nomargin">
              http://www.d-dome.net/idapython
      </p></th></tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;idautils
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript: void(0);" class="privatelink"
    onclick="toggle_private();">hide private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="idautils-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h2 class="py-src">Source Code for <a href="idautils-module.html">Module idautils</a></h2>
<div class="py-src">
<pre class="py-src">
<span class="lineno">  1</span>  <span class="py-line"><span class="py-comment">#------------------------------------------------------------</span> </span>
<span class="lineno">  2</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># IDAPython - Python plugin for Interactive Disassembler Pro</span> </span>
<span class="lineno">  3</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment">#</span> </span>
<span class="lineno">  4</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># Copyright (c) 2004-2006 Gergely Erdelyi &lt;dyce@d-dome.net&gt; </span> </span>
<span class="lineno">  5</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment">#</span> </span>
<span class="lineno">  6</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># All rights reserved.</span> </span>
<span class="lineno">  7</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment">#</span> </span>
<span class="lineno">  8</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># For detailed copyright information see the file COPYING in</span> </span>
<span class="lineno">  9</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment"># the root of the distribution archive.</span> </span>
<span class="lineno"> 10</span>  <span class="py-line"><span class="py-comment"></span><span class="py-comment">#------------------------------------------------------------</span> </span>
<span class="lineno"> 11</span>  <span class="py-line"><span class="py-comment"></span><span class="py-docstring">"""</span> </span>
<span class="lineno"> 12</span>  <span class="py-line"><span class="py-docstring">idautils.py - High level utility functions for IDA</span> </span>
<span class="lineno"> 13</span>  <span class="py-line"><span class="py-docstring">"""</span> </span>
<span class="lineno"> 14</span>  <span class="py-line"><span class="py-keyword">from</span> <a title="idaapi" class="py-name" href="idaapi-module.html">idaapi</a> <span class="py-keyword">import</span> <span class="py-op">*</span> </span>
<span class="lineno"> 15</span>  <span class="py-line"> </span>
<a name="refs"></a><div id="refs-def"><span class="lineno"> 16</span> <a class="pysrc-toggle" href="#" id="refs-toggle" onclick="toggle('refs'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">funcfirst</span><span class="py-op">,</span> <span class="py-param">funcnext</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="refs-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="refs-expanded"><span class="lineno"> 17</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno"> 18</span>  <span class="py-line"><span class="py-docstring">        Generic reference collector - INTERNAL USE ONLY.</span> </span>
<span class="lineno"> 19</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno"> 20</span>  <span class="py-line">        <span class="py-name">reflist</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="lineno"> 21</span>  <span class="py-line"> </span>
<span class="lineno"> 22</span>  <span class="py-line">        <span class="py-name">ref</span> <span class="py-op">=</span> <span class="py-name">funcfirst</span><span class="py-op">(</span><span id="link-0" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-0', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">)</span> </span>
<span class="lineno"> 23</span>  <span class="py-line"> </span>
<span class="lineno"> 24</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">ref</span> <span class="py-op">!=</span> <span id="link-1" class="py-name"><a title="idaapi.BADADDR
idc.BADADDR" class="py-name" href="#" onclick="doclink('link-1', 'BADADDR', 'Variable idaapi.BADADDR=idaapi-module.html#BADADDR,Variable idc.BADADDR=idc-module.html#BADADDR'); return false;">BADADDR</a></span></span><span class="py-op">:</span> </span>
<span class="lineno"> 25</span>  <span class="py-line">                <span class="py-name">reflist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">ref</span><span class="py-op">)</span> </span>
<span class="lineno"> 26</span>  <span class="py-line"> </span>
<span class="lineno"> 27</span>  <span class="py-line">                <span class="py-keyword">while</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno"> 28</span>  <span class="py-line">                        <span class="py-name">ref</span> <span class="py-op">=</span> <span class="py-name">funcnext</span><span class="py-op">(</span><span id="link-2" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-2', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <span class="py-name">ref</span><span class="py-op">)</span> </span>
<span class="lineno"> 29</span>  <span class="py-line"> </span>
<span class="lineno"> 30</span>  <span class="py-line">                        <span class="py-keyword">if</span> <span class="py-name">ref</span> <span class="py-op">==</span> <span id="link-3" class="py-name"><a title="idaapi.BADADDR
idc.BADADDR" class="py-name" href="#" onclick="doclink('link-3', 'BADADDR', 'Variable idaapi.BADADDR=idaapi-module.html#BADADDR,Variable idc.BADADDR=idc-module.html#BADADDR'); return false;">BADADDR</a></span></span><span class="py-op">:</span> </span>
<span class="lineno"> 31</span>  <span class="py-line">                                <span class="py-keyword">break</span> </span>
<span class="lineno"> 32</span>  <span class="py-line">                        <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno"> 33</span>  <span class="py-line">                                <span class="py-name">reflist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">ref</span><span class="py-op">)</span> </span>
<span class="lineno"> 34</span>  <span class="py-line">         </span>
<span class="lineno"> 35</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">reflist</span> </span>
</div><span class="lineno"> 36</span>  <span class="py-line">         </span>
<span class="lineno"> 37</span>  <span class="py-line"> </span>
<a name="CodeRefsTo"></a><div id="CodeRefsTo-def"><span class="lineno"> 38</span> <a class="pysrc-toggle" href="#" id="CodeRefsTo-toggle" onclick="toggle('CodeRefsTo'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#CodeRefsTo">CodeRefsTo</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">flow</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="CodeRefsTo-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CodeRefsTo-expanded"><span class="lineno"> 39</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno"> 40</span>  <span class="py-line"><span class="py-docstring">        Get a list of code references to 'ea'</span> </span>
<span class="lineno"> 41</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 42</span>  <span class="py-line"><span class="py-docstring">        @param ea:   Target address</span> </span>
<span class="lineno"> 43</span>  <span class="py-line"><span class="py-docstring">        @param flow: Follow normal code flow or not </span> </span>
<span class="lineno"> 44</span>  <span class="py-line"><span class="py-docstring">        @type  flow: Boolean (0/1, False/True)</span> </span>
<span class="lineno"> 45</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 46</span>  <span class="py-line"><span class="py-docstring">        @return: list of references (may be empty list)</span> </span>
<span class="lineno"> 47</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 48</span>  <span class="py-line"><span class="py-docstring">        Example::</span> </span>
<span class="lineno"> 49</span>  <span class="py-line"><span class="py-docstring">        </span> </span>
<span class="lineno"> 50</span>  <span class="py-line"><span class="py-docstring">                for ref in CodeRefsTo(ScreenEA(), 1):</span> </span>
<span class="lineno"> 51</span>  <span class="py-line"><span class="py-docstring">                        print ref</span> </span>
<span class="lineno"> 52</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno"> 53</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">flow</span> <span class="py-op">==</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno"> 54</span>  <span class="py-line">                <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-4" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-4', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_cref_to" class="py-name" href="idaapi-module.html#get_first_cref_to">get_first_cref_to</a><span class="py-op">,</span> <a title="idaapi.get_next_cref_to" class="py-name" href="idaapi-module.html#get_next_cref_to">get_next_cref_to</a><span class="py-op">)</span>     </span>
<span class="lineno"> 55</span>  <span class="py-line">        <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno"> 56</span>  <span class="py-line">                <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-5" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-5', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_fcref_to" class="py-name" href="idaapi-module.html#get_first_fcref_to">get_first_fcref_to</a><span class="py-op">,</span> <a title="idaapi.get_next_fcref_to" class="py-name" href="idaapi-module.html#get_next_fcref_to">get_next_fcref_to</a><span class="py-op">)</span>   </span>
</div><span class="lineno"> 57</span>  <span class="py-line"> </span>
<span class="lineno"> 58</span>  <span class="py-line"> </span>
<a name="CodeRefsFrom"></a><div id="CodeRefsFrom-def"><span class="lineno"> 59</span> <a class="pysrc-toggle" href="#" id="CodeRefsFrom-toggle" onclick="toggle('CodeRefsFrom'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#CodeRefsFrom">CodeRefsFrom</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">flow</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="CodeRefsFrom-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="CodeRefsFrom-expanded"><span class="lineno"> 60</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno"> 61</span>  <span class="py-line"><span class="py-docstring">        Get a list of code references from 'ea'</span> </span>
<span class="lineno"> 62</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 63</span>  <span class="py-line"><span class="py-docstring">        @param ea:   Target address</span> </span>
<span class="lineno"> 64</span>  <span class="py-line"><span class="py-docstring">        @param flow: Follow normal code flow or not </span> </span>
<span class="lineno"> 65</span>  <span class="py-line"><span class="py-docstring">        @type  flow: Boolean (0/1, False/True)</span> </span>
<span class="lineno"> 66</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 67</span>  <span class="py-line"><span class="py-docstring">        @return: list of references (may be empty list)</span> </span>
<span class="lineno"> 68</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 69</span>  <span class="py-line"><span class="py-docstring">        Example::</span> </span>
<span class="lineno"> 70</span>  <span class="py-line"><span class="py-docstring">        </span> </span>
<span class="lineno"> 71</span>  <span class="py-line"><span class="py-docstring">                for ref in CodeRefsFrom(ScreenEA(), 1):</span> </span>
<span class="lineno"> 72</span>  <span class="py-line"><span class="py-docstring">                        print ref</span> </span>
<span class="lineno"> 73</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno"> 74</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">flow</span> <span class="py-op">==</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno"> 75</span>  <span class="py-line">                <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-6" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-6', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_cref_from" class="py-name" href="idaapi-module.html#get_first_cref_from">get_first_cref_from</a><span class="py-op">,</span> <a title="idaapi.get_next_cref_from" class="py-name" href="idaapi-module.html#get_next_cref_from">get_next_cref_from</a><span class="py-op">)</span>         </span>
<span class="lineno"> 76</span>  <span class="py-line">        <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno"> 77</span>  <span class="py-line">                <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-7" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-7', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_fcref_from" class="py-name" href="idaapi-module.html#get_first_fcref_from">get_first_fcref_from</a><span class="py-op">,</span> <a title="idaapi.get_next_fcref_from" class="py-name" href="idaapi-module.html#get_next_fcref_from">get_next_fcref_from</a><span class="py-op">)</span>       </span>
</div><span class="lineno"> 78</span>  <span class="py-line"> </span>
<span class="lineno"> 79</span>  <span class="py-line"> </span>
<a name="DataRefsTo"></a><div id="DataRefsTo-def"><span class="lineno"> 80</span> <a class="pysrc-toggle" href="#" id="DataRefsTo-toggle" onclick="toggle('DataRefsTo'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#DataRefsTo">DataRefsTo</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="DataRefsTo-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DataRefsTo-expanded"><span class="lineno"> 81</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno"> 82</span>  <span class="py-line"><span class="py-docstring">        Get a list of data references to 'ea'</span> </span>
<span class="lineno"> 83</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 84</span>  <span class="py-line"><span class="py-docstring">        @param ea:   Target address</span> </span>
<span class="lineno"> 85</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 86</span>  <span class="py-line"><span class="py-docstring">        @return: list of references (may be empty list)</span> </span>
<span class="lineno"> 87</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno"> 88</span>  <span class="py-line"><span class="py-docstring">        Example::</span> </span>
<span class="lineno"> 89</span>  <span class="py-line"><span class="py-docstring">        </span> </span>
<span class="lineno"> 90</span>  <span class="py-line"><span class="py-docstring">                for ref in DataRefsTo(ScreenEA(), 1):</span> </span>
<span class="lineno"> 91</span>  <span class="py-line"><span class="py-docstring">                        print ref</span> </span>
<span class="lineno"> 92</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno"> 93</span>  <span class="py-line">        <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-8" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-8', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_dref_to" class="py-name" href="idaapi-module.html#get_first_dref_to">get_first_dref_to</a><span class="py-op">,</span> <a title="idaapi.get_next_dref_to" class="py-name" href="idaapi-module.html#get_next_dref_to">get_next_dref_to</a><span class="py-op">)</span>     </span>
</div><span class="lineno"> 94</span>  <span class="py-line"> </span>
<span class="lineno"> 95</span>  <span class="py-line"> </span>
<a name="DataRefsFrom"></a><div id="DataRefsFrom-def"><span class="lineno"> 96</span> <a class="pysrc-toggle" href="#" id="DataRefsFrom-toggle" onclick="toggle('DataRefsFrom'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#DataRefsFrom">DataRefsFrom</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="DataRefsFrom-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="DataRefsFrom-expanded"><span class="lineno"> 97</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno"> 98</span>  <span class="py-line"><span class="py-docstring">        Get a list of data references from 'ea'</span> </span>
<span class="lineno"> 99</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">100</span>  <span class="py-line"><span class="py-docstring">        @param ea:   Target address</span> </span>
<span class="lineno">101</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">102</span>  <span class="py-line"><span class="py-docstring">        @return: list of references (may be empty list)</span> </span>
<span class="lineno">103</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">104</span>  <span class="py-line"><span class="py-docstring">        Example::</span> </span>
<span class="lineno">105</span>  <span class="py-line"><span class="py-docstring">        </span> </span>
<span class="lineno">106</span>  <span class="py-line"><span class="py-docstring">                for ref in DataRefsFrom(ScreenEA(), 1):</span> </span>
<span class="lineno">107</span>  <span class="py-line"><span class="py-docstring">                        print ref</span> </span>
<span class="lineno">108</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">109</span>  <span class="py-line">        <span class="py-keyword">return</span> <a title="idautils.refs" class="py-name" href="idautils-module.html#refs">refs</a><span class="py-op">(</span><span id="link-9" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-9', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.get_first_dref_from" class="py-name" href="idaapi-module.html#get_first_dref_from">get_first_dref_from</a><span class="py-op">,</span> <a title="idaapi.get_next_dref_from" class="py-name" href="idaapi-module.html#get_next_dref_from">get_next_dref_from</a><span class="py-op">)</span>         </span>
</div><span class="lineno">110</span>  <span class="py-line"> </span>
<span class="lineno">111</span>  <span class="py-line"> </span>
<a name="Heads"></a><div id="Heads-def"><span class="lineno">112</span> <a class="pysrc-toggle" href="#" id="Heads-toggle" onclick="toggle('Heads'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#Heads">Heads</a><span class="py-op">(</span><span class="py-param">start</span><span class="py-op">,</span> <span class="py-param">end</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="Heads-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Heads-expanded"><span class="lineno">113</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">114</span>  <span class="py-line"><span class="py-docstring">        Get a list of heads (instructions or data)</span> </span>
<span class="lineno">115</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">116</span>  <span class="py-line"><span class="py-docstring">        @param start: start address (this one is always included)</span> </span>
<span class="lineno">117</span>  <span class="py-line"><span class="py-docstring">        @param end:   end address</span> </span>
<span class="lineno">118</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">119</span>  <span class="py-line"><span class="py-docstring">        @return: list of heads between start and end</span> </span>
<span class="lineno">120</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">121</span>  <span class="py-line">        <span class="py-name">headlist</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="lineno">122</span>  <span class="py-line">        <span class="py-name">headlist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">start</span><span class="py-op">)</span> </span>
<span class="lineno">123</span>  <span class="py-line"> </span>
<span class="lineno">124</span>  <span class="py-line">        <span id="link-10" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-10', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span class="py-name">start</span> </span>
<span class="lineno">125</span>  <span class="py-line"> </span>
<span class="lineno">126</span>  <span class="py-line">        <span class="py-keyword">while</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno">127</span>  <span class="py-line">                <span id="link-11" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-11', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span id="link-12" class="py-name"><a title="idaapi.func_item_iterator_t.next_head
idaapi.next_head" class="py-name" href="#" onclick="doclink('link-12', 'next_head', 'Method idaapi.func_item_iterator_t.next_head()=idaapi.func_item_iterator_t-class.html#next_head,Function idaapi.next_head()=idaapi-module.html#next_head'); return false;">next_head</a></span></span><span class="py-op">(</span><span id="link-13" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-13', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <span class="py-name">end</span><span class="py-op">)</span> </span>
<span class="lineno">128</span>  <span class="py-line"> </span>
<span class="lineno">129</span>  <span class="py-line">                <span class="py-keyword">if</span> <span id="link-14" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-14', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">==</span> <span id="link-15" class="py-name"><a title="idaapi.BADADDR
idc.BADADDR" class="py-name" href="#" onclick="doclink('link-15', 'BADADDR', 'Variable idaapi.BADADDR=idaapi-module.html#BADADDR,Variable idc.BADADDR=idc-module.html#BADADDR'); return false;">BADADDR</a></span></span><span class="py-op">:</span> </span>
<span class="lineno">130</span>  <span class="py-line">                        <span class="py-keyword">break</span> </span>
<span class="lineno">131</span>  <span class="py-line">                <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno">132</span>  <span class="py-line">                        <span class="py-name">headlist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span id="link-16" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-16', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">)</span> </span>
<span class="lineno">133</span>  <span class="py-line">         </span>
<span class="lineno">134</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">headlist</span> </span>
</div><span class="lineno">135</span>  <span class="py-line">         </span>
<span class="lineno">136</span>  <span class="py-line"> </span>
<a name="Functions"></a><div id="Functions-def"><span class="lineno">137</span> <a class="pysrc-toggle" href="#" id="Functions-toggle" onclick="toggle('Functions'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#Functions">Functions</a><span class="py-op">(</span><span class="py-param">start</span><span class="py-op">,</span> <span class="py-param">end</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="Functions-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Functions-expanded"><span class="lineno">138</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">139</span>  <span class="py-line"><span class="py-docstring">        Get a list of functions</span> </span>
<span class="lineno">140</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">141</span>  <span class="py-line"><span class="py-docstring">        @param start: start address</span> </span>
<span class="lineno">142</span>  <span class="py-line"><span class="py-docstring">        @param end:   end address</span> </span>
<span class="lineno">143</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">144</span>  <span class="py-line"><span class="py-docstring">        @return: list of heads between start and end</span> </span>
<span class="lineno">145</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">146</span>  <span class="py-line"><span class="py-docstring">        @note: The last function that starts before 'end' is included even</span> </span>
<span class="lineno">147</span>  <span class="py-line"><span class="py-docstring">        if it extends beyond 'end'.</span> </span>
<span class="lineno">148</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">149</span>  <span class="py-line">        <span class="py-name">startaddr</span> <span class="py-op">=</span> <span class="py-name">start</span> </span>
<span class="lineno">150</span>  <span class="py-line">        <span class="py-name">endaddr</span> <span class="py-op">=</span> <span class="py-name">end</span> </span>
<span class="lineno">151</span>  <span class="py-line"> </span>
<span class="lineno">152</span>  <span class="py-line">        <span class="py-name">funclist</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="lineno">153</span>  <span class="py-line"> </span>
<span class="lineno">154</span>  <span class="py-line">        <span class="py-name">func</span> <span class="py-op">=</span> <a title="idaapi.get_func" class="py-name" href="idaapi-module.html#get_func">get_func</a><span class="py-op">(</span><span class="py-name">start</span><span class="py-op">)</span> </span>
<span class="lineno">155</span>  <span class="py-line"> </span>
<span class="lineno">156</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">func</span><span class="py-op">:</span> </span>
<span class="lineno">157</span>  <span class="py-line">                <span class="py-name">funclist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">func</span><span class="py-op">.</span><a title="idaapi.area_t.startEA" class="py-name" href="idaapi.area_t-class.html#startEA">startEA</a><span class="py-op">)</span> </span>
<span class="lineno">158</span>  <span class="py-line"> </span>
<span class="lineno">159</span>  <span class="py-line">        <span id="link-17" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-17', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span class="py-name">start</span> </span>
<span class="lineno">160</span>  <span class="py-line"> </span>
<span class="lineno">161</span>  <span class="py-line">        <span class="py-keyword">while</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno">162</span>  <span class="py-line">                <span class="py-name">func</span> <span class="py-op">=</span> <a title="idaapi.get_next_func" class="py-name" href="idaapi-module.html#get_next_func">get_next_func</a><span class="py-op">(</span><span id="link-18" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-18', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">)</span> </span>
<span class="lineno">163</span>  <span class="py-line"> </span>
<span class="lineno">164</span>  <span class="py-line">                <span class="py-keyword">if</span> <span class="py-keyword">not</span> <span class="py-name">func</span><span class="py-op">:</span> <span class="py-keyword">break</span> </span>
<span class="lineno">165</span>  <span class="py-line"> </span>
<span class="lineno">166</span>  <span class="py-line">                <span class="py-keyword">if</span> <span class="py-name">func</span><span class="py-op">.</span><a title="idaapi.area_t.startEA" class="py-name" href="idaapi.area_t-class.html#startEA">startEA</a> <span class="py-op">&lt;</span> <span class="py-name">end</span><span class="py-op">:</span> </span>
<span class="lineno">167</span>  <span class="py-line">                        <span class="py-name">funclist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">func</span><span class="py-op">.</span><a title="idaapi.area_t.startEA" class="py-name" href="idaapi.area_t-class.html#startEA">startEA</a><span class="py-op">)</span> </span>
<span class="lineno">168</span>  <span class="py-line">                        <span id="link-19" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-19', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span class="py-name">func</span><span class="py-op">.</span><a title="idaapi.area_t.startEA" class="py-name" href="idaapi.area_t-class.html#startEA">startEA</a> </span>
<span class="lineno">169</span>  <span class="py-line">                <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno">170</span>  <span class="py-line">                        <span class="py-keyword">break</span> </span>
<span class="lineno">171</span>  <span class="py-line"> </span>
<span class="lineno">172</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">funclist</span> </span>
</div><span class="lineno">173</span>  <span class="py-line">         </span>
<span class="lineno">174</span>  <span class="py-line"> </span>
<a name="Segments"></a><div id="Segments-def"><span class="lineno">175</span> <a class="pysrc-toggle" href="#" id="Segments-toggle" onclick="toggle('Segments'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#Segments">Segments</a><span class="py-op">(</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="Segments-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Segments-expanded"><span class="lineno">176</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">177</span>  <span class="py-line"><span class="py-docstring">        Get list of segments (sections) in the binary image</span> </span>
<span class="lineno">178</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">179</span>  <span class="py-line"><span class="py-docstring">        @return: List of segment start addresses.</span> </span>
<span class="lineno">180</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">181</span>  <span class="py-line">        <span class="py-name">seglist</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="lineno">182</span>  <span class="py-line"> </span>
<span class="lineno">183</span>  <span class="py-line">        <span class="py-keyword">for</span> <a title="idaapi.op_t.n" class="py-name" href="idaapi.op_t-class.html#n">n</a> <span class="py-keyword">in</span> <span class="py-name">range</span><span class="py-op">(</span><a title="idaapi.get_segm_qty" class="py-name" href="idaapi-module.html#get_segm_qty">get_segm_qty</a><span class="py-op">(</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="lineno">184</span>  <span class="py-line">                <span class="py-name">seg</span> <span class="py-op">=</span> <a title="idaapi.getnseg" class="py-name" href="idaapi-module.html#getnseg">getnseg</a><span class="py-op">(</span><a title="idaapi.op_t.n" class="py-name" href="idaapi.op_t-class.html#n">n</a><span class="py-op">)</span> </span>
<span class="lineno">185</span>  <span class="py-line"> </span>
<span class="lineno">186</span>  <span class="py-line">                <span class="py-keyword">if</span> <span class="py-keyword">not</span> <span class="py-name">seg</span><span class="py-op">:</span> </span>
<span class="lineno">187</span>  <span class="py-line">                        <span class="py-keyword">break</span> </span>
<span class="lineno">188</span>  <span class="py-line">                <span class="py-keyword">else</span><span class="py-op">:</span> </span>
<span class="lineno">189</span>  <span class="py-line">                        <span class="py-name">seglist</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">seg</span><span class="py-op">.</span><a title="idaapi.area_t.startEA" class="py-name" href="idaapi.area_t-class.html#startEA">startEA</a><span class="py-op">)</span> </span>
<span class="lineno">190</span>  <span class="py-line">         </span>
<span class="lineno">191</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">seglist</span> </span>
</div><span class="lineno">192</span>  <span class="py-line"> </span>
<span class="lineno">193</span>  <span class="py-line"> </span>
<a name="GetDataList"></a><div id="GetDataList-def"><span class="lineno">194</span> <a class="pysrc-toggle" href="#" id="GetDataList-toggle" onclick="toggle('GetDataList'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#GetDataList">GetDataList</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">count</span><span class="py-op">,</span> <span class="py-param">itemsize</span><span class="py-op">=</span><span class="py-number">1</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="GetDataList-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="GetDataList-expanded"><span class="lineno">195</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">196</span>  <span class="py-line"><span class="py-docstring">        Get data list - INTERNAL USE ONLY</span> </span>
<span class="lineno">197</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">198</span>  <span class="py-line">        <span class="py-name">getdata</span> <span class="py-op">=</span> <span class="py-name">None</span> </span>
<span class="lineno">199</span>  <span class="py-line"> </span>
<span class="lineno">200</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno">201</span>  <span class="py-line">                <span class="py-name">getdata</span> <span class="py-op">=</span> <a title="idaapi.get_byte" class="py-name" href="idaapi-module.html#get_byte">get_byte</a> </span>
<span class="lineno">202</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">2</span><span class="py-op">:</span> </span>
<span class="lineno">203</span>  <span class="py-line">                <span class="py-name">getdata</span> <span class="py-op">=</span> <a title="idaapi.get_word" class="py-name" href="idaapi-module.html#get_word">get_word</a> </span>
<span class="lineno">204</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">4</span><span class="py-op">:</span> </span>
<span class="lineno">205</span>  <span class="py-line">                <span class="py-name">getdata</span> <span class="py-op">=</span> <span class="py-name">get_dword</span> </span>
<span class="lineno">206</span>  <span class="py-line"> </span>
<span class="lineno">207</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">getdata</span> <span class="py-op">==</span> <span class="py-name">None</span><span class="py-op">:</span> </span>
<span class="lineno">208</span>  <span class="py-line">                <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">,</span> <span class="py-string">"Invalid data size! Must be 1, 2 or 4"</span> </span>
<span class="lineno">209</span>  <span class="py-line"> </span>
<span class="lineno">210</span>  <span class="py-line">        <span class="py-name">list</span> <span class="py-op">=</span> <span class="py-op">[</span><span class="py-op">]</span> </span>
<span class="lineno">211</span>  <span class="py-line"> </span>
<span class="lineno">212</span>  <span class="py-line">        <span class="py-keyword">for</span> <span class="py-name">offs</span> <span class="py-keyword">in</span> <span class="py-name">range</span><span class="py-op">(</span><span class="py-name">count</span><span class="py-op">)</span><span class="py-op">:</span> </span>
<span class="lineno">213</span>  <span class="py-line">                <span class="py-name">list</span><span class="py-op">.</span><span class="py-name">append</span><span class="py-op">(</span><span class="py-name">getdata</span><span class="py-op">(</span><span id="link-20" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-20', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">)</span><span class="py-op">)</span> </span>
<span class="lineno">214</span>  <span class="py-line">                <span id="link-21" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-21', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span id="link-22" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-22', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">+</span> <span class="py-name">itemsize</span> </span>
<span class="lineno">215</span>  <span class="py-line"> </span>
<span class="lineno">216</span>  <span class="py-line">        <span class="py-keyword">return</span> <span class="py-name">list</span> </span>
</div><span class="lineno">217</span>  <span class="py-line"> </span>
<span class="lineno">218</span>  <span class="py-line"> </span>
<a name="PutDataList"></a><div id="PutDataList-def"><span class="lineno">219</span> <a class="pysrc-toggle" href="#" id="PutDataList-toggle" onclick="toggle('PutDataList'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#PutDataList">PutDataList</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">list</span><span class="py-op">,</span> <span class="py-param">itemsize</span><span class="py-op">=</span><span class="py-number">1</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="PutDataList-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="PutDataList-expanded"><span class="lineno">220</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">221</span>  <span class="py-line"><span class="py-docstring">        Put data list - INTERNAL USE ONLY</span> </span>
<span class="lineno">222</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">223</span>  <span class="py-line">        <span class="py-name">putdata</span> <span class="py-op">=</span> <span class="py-name">None</span> </span>
<span class="lineno">224</span>  <span class="py-line"> </span>
<span class="lineno">225</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">1</span><span class="py-op">:</span> </span>
<span class="lineno">226</span>  <span class="py-line">                <span class="py-name">putdata</span> <span class="py-op">=</span> <a title="idaapi.patch_byte" class="py-name" href="idaapi-module.html#patch_byte">patch_byte</a> </span>
<span class="lineno">227</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">2</span><span class="py-op">:</span> </span>
<span class="lineno">228</span>  <span class="py-line">                <span class="py-name">putdata</span> <span class="py-op">=</span> <a title="idaapi.patch_word" class="py-name" href="idaapi-module.html#patch_word">patch_word</a> </span>
<span class="lineno">229</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">itemsize</span> <span class="py-op">==</span> <span class="py-number">4</span><span class="py-op">:</span> </span>
<span class="lineno">230</span>  <span class="py-line">                <span class="py-name">putdata</span> <span class="py-op">=</span> <span class="py-name">patch_dword</span> </span>
<span class="lineno">231</span>  <span class="py-line"> </span>
<span class="lineno">232</span>  <span class="py-line">        <span class="py-keyword">if</span> <span class="py-name">putdata</span> <span class="py-op">==</span> <span class="py-name">None</span><span class="py-op">:</span> </span>
<span class="lineno">233</span>  <span class="py-line">                <span class="py-keyword">raise</span> <span class="py-name">ValueError</span><span class="py-op">,</span> <span class="py-string">"Invalid data size! Must be 1, 2 or 4"</span> </span>
<span class="lineno">234</span>  <span class="py-line"> </span>
<span class="lineno">235</span>  <span class="py-line">        <span class="py-keyword">for</span> <span class="py-name">val</span> <span class="py-keyword">in</span> <span class="py-name">list</span><span class="py-op">:</span> </span>
<span class="lineno">236</span>  <span class="py-line">                <span class="py-name">putdata</span><span class="py-op">(</span><span id="link-23" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-23', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <span class="py-name">val</span><span class="py-op">)</span> </span>
<span class="lineno">237</span>  <span class="py-line">                <span id="link-24" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-24', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">=</span> <span id="link-25" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-25', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span> <span class="py-op">+</span> <span class="py-name">itemsize</span> </span>
</div><span class="lineno">238</span>  <span class="py-line"> </span>
<a name="MapDataList"></a><div id="MapDataList-def"><span class="lineno">239</span> <a class="pysrc-toggle" href="#" id="MapDataList-toggle" onclick="toggle('MapDataList'); return false;">-</a><span class="py-line"><span class="py-keyword">def</span> <a class="py-def-name" href="idautils-module.html#MapDataList">MapDataList</a><span class="py-op">(</span><span class="py-param">ea</span><span class="py-op">,</span> <span class="py-param">length</span><span class="py-op">,</span> <span class="py-param">func</span><span class="py-op">,</span> <span class="py-param">wordsize</span><span class="py-op">=</span><span class="py-number">1</span><span class="py-op">)</span><span class="py-op">:</span> </span>
</div><div id="MapDataList-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="MapDataList-expanded"><span class="lineno">240</span>  <span class="py-line">        <span class="py-docstring">"""</span> </span>
<span class="lineno">241</span>  <span class="py-line"><span class="py-docstring">        Map through a list of data words in the database</span> </span>
<span class="lineno">242</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">243</span>  <span class="py-line"><span class="py-docstring">        @param ea:       start address</span> </span>
<span class="lineno">244</span>  <span class="py-line"><span class="py-docstring">        @param length:   number of words to map</span> </span>
<span class="lineno">245</span>  <span class="py-line"><span class="py-docstring">        @param func:     mapping function</span> </span>
<span class="lineno">246</span>  <span class="py-line"><span class="py-docstring">        @param wordsize: size of words to map [default: 1 byte]</span> </span>
<span class="lineno">247</span>  <span class="py-line"><span class="py-docstring"></span> </span>
<span class="lineno">248</span>  <span class="py-line"><span class="py-docstring">        @return: None</span> </span>
<span class="lineno">249</span>  <span class="py-line"><span class="py-docstring">        """</span> </span>
<span class="lineno">250</span>  <span class="py-line">        <a title="idautils.PutDataList" class="py-name" href="idautils-module.html#PutDataList">PutDataList</a><span class="py-op">(</span><span id="link-26" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-26', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <span class="py-name">map</span><span class="py-op">(</span><span class="py-name">func</span><span class="py-op">,</span> <a title="idautils.GetDataList" class="py-name" href="idautils-module.html#GetDataList">GetDataList</a><span class="py-op">(</span><span id="link-27" class="py-name"><a title="idaapi.bpt_t.ea
idaapi.curloc.ea
idaapi.insn_t.ea
idaapi.llabel_t.ea
idaapi.stkpnt_t.ea
idaapi.string_info_t.ea
idaapi.tev_info_t.ea" class="py-name" href="#" onclick="doclink('link-27', 'ea', 'Variable idaapi.bpt_t.ea=idaapi.bpt_t-class.html#ea,Variable idaapi.curloc.ea=idaapi.curloc-class.html#ea,Variable idaapi.insn_t.ea=idaapi.insn_t-class.html#ea,Variable idaapi.llabel_t.ea=idaapi.llabel_t-class.html#ea,Variable idaapi.stkpnt_t.ea=idaapi.stkpnt_t-class.html#ea,Variable idaapi.string_info_t.ea=idaapi.string_info_t-class.html#ea,Variable idaapi.tev_info_t.ea=idaapi.tev_info_t-class.html#ea'); return false;">ea</a></span></span><span class="py-op">,</span> <a title="idaapi.string_info_t.length" class="py-name" href="idaapi.string_info_t-class.html#length">length</a><span class="py-op">,</span> <span class="py-name">wordsize</span><span class="py-op">)</span><span class="py-op">)</span><span class="py-op">,</span> <span class="py-name">wordsize</span><span class="py-op">)</span> </span>
</div><span class="lineno">251</span>  <span class="py-line"> </span><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar"
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center">
            <p class="nomargin">
              http://www.d-dome.net/idapython
      </p></th></tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">Generated by Epydoc
        3.0alpha2 on Tue Mar 27 17:02:09 2007</td>
    <td align="right" class="footer">
      <a href="http://epydoc.sourceforge.net">http://epydoc.sf.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie()
  // -->
</script>
  
</body>
</html>
